package com.fss.category1.service.impl;

import java.util.List;
import com.fss.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fss.category1.mapper.Category1Mapper;
import com.fss.category1.domain.Category1;
import com.fss.category1.service.ICategory1Service;

/**
 * 农产品品类Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-12-02
 */
@Service
public class Category1ServiceImpl implements ICategory1Service 
{
    @Autowired
    private Category1Mapper category1Mapper;

    /**
     * 查询农产品品类
     * 
     * @param categoryId 农产品品类主键
     * @return 农产品品类
     */
    @Override
    public Category1 selectCategory1ByCategoryId(Long categoryId)
    {
        return category1Mapper.selectCategory1ByCategoryId(categoryId);
    }

    /**
     * 查询农产品品类列表
     * 
     * @param category1 农产品品类
     * @return 农产品品类
     */
    @Override
    public List<Category1> selectCategory1List(Category1 category1)
    {
        return category1Mapper.selectCategory1List(category1);
    }

    /**
     * 新增农产品品类
     * 
     * @param category1 农产品品类
     * @return 结果
     */
    @Override
    public int insertCategory1(Category1 category1)
    {
        category1.setCreateTime(DateUtils.getNowDate());
        return category1Mapper.insertCategory1(category1);
    }

    /**
     * 修改农产品品类
     * 
     * @param category1 农产品品类
     * @return 结果
     */
    @Override
    public int updateCategory1(Category1 category1)
    {
        category1.setUpdateTime(DateUtils.getNowDate());
        return category1Mapper.updateCategory1(category1);
    }

    /**
     * 批量删除农产品品类
     * 
     * @param categoryIds 需要删除的农产品品类主键
     * @return 结果
     */
    @Override
    public int deleteCategory1ByCategoryIds(Long[] categoryIds)
    {
        return category1Mapper.deleteCategory1ByCategoryIds(categoryIds);
    }

    /**
     * 删除农产品品类信息
     * 
     * @param categoryId 农产品品类主键
     * @return 结果
     */
    @Override
    public int deleteCategory1ByCategoryId(Long categoryId)
    {
        return category1Mapper.deleteCategory1ByCategoryId(categoryId);
    }
}
